home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sys / stat.h.rab < prev    next >
Text File  |  1991-12-18  |  3KB  |  97 lines

  1. /*
  2.  * Copyright (c) 1982, 1986 Regents of the University of California.
  3.  * All rights reserved.  The Berkeley software License Agreement
  4.  * specifies the terms and conditions for redistribution.
  5.  *
  6.  *    @(#)stat.h    7.1 (Berkeley) 6/4/86
  7.  * $Header: /sprite/src/lib/include/sys/RCS/stat.h,v 1.10 91/12/16 14:02:05 rab Exp Locker: rab $
  8.  */
  9.  
  10. #ifndef _STAT
  11. #define _STAT
  12.  
  13. #include <cfuncproto.h>
  14.  
  15. struct    stat
  16. {
  17.     dev_t    st_dev;
  18.     ino_t    st_ino;
  19.     unsigned short st_mode;
  20.     short    st_nlink;
  21.     uid_t    st_uid;
  22.     gid_t    st_gid;
  23.     dev_t    st_rdev;
  24.     off_t    st_size;
  25.     time_t    st_atime;
  26.     int    st_spare1;
  27.     time_t    st_mtime;
  28.     int    st_spare2;
  29.     time_t    st_ctime;
  30.     int    st_spare3;
  31.     long    st_blksize;
  32.     long    st_blocks;
  33.     long    st_serverID;
  34.     long    st_version;
  35.     long    st_userType;
  36.     long    st_devServerID;
  37. };
  38.  
  39. #define    S_IFMT    0170000        /* type of file */
  40. #define    _IFMT    0170000        /* type of file */
  41. #define        S_IFDIR    0040000    /* directory */
  42. #define        S_IFCHR    0020000    /* character special */
  43. #define        S_IFBLK    0060000    /* block special */
  44. #define        S_IFREG    0100000    /* regular */
  45. #define        S_IFLNK    0120000    /* symbolic link */
  46. #define        S_IFSOCK 0140000/* socket */
  47. #define        S_IFIFO    0010000    /* fifo */
  48. /* Extra Sprite types */
  49. #define        S_IFPDEV 0150000 /* pseudo-device */
  50. #define        S_IFRLNK 0160000 /* remote link */
  51. #define    S_ISUID    0004000        /* set user id on execution */
  52. #define    S_ISGID    0002000        /* set group id on execution */
  53. #define    S_ISVTX    0001000        /* save swapped text even after use */
  54. #define    S_IREAD    0000400        /* read permission, owner */
  55. #define    S_IWRITE 0000200    /* write permission, owner */
  56. #define    S_IEXEC    0000100        /* execute/search permission, owner */
  57.  
  58. #define S_ISBLK(m)      (((m)&_IFMT) == S_IFBLK)
  59. #define S_ISCHR(m)      (((m)&_IFMT) == S_IFCHR)
  60. #define S_ISDIR(m)      (((m)&_IFMT) == S_IFDIR)
  61. #define S_ISFIFO(m)     (((m)&_IFMT) == S_IFIFO)
  62. #define S_ISREG(m)      (((m)&_IFMT) == S_IFREG)
  63. #ifndef _POSIX_SOURCE
  64. #define S_ISLNK(m)      (((m)&_IFMT) == S_IFLNK)
  65. #define S_ISSOCK(m)     (((m)&_IFMT) == S_IFSOCK)
  66. #endif
  67.  
  68. /*
  69.  * User-defined file types.  A number of types are standardized, but others
  70.  * may be defined by the user.
  71.  *
  72.  *     S_TYPE_UNDEFINED    - no type set
  73.  *     S_TYPE_TMP          - temporary file
  74.  *     S_TYPE_SWAP         - swap file
  75.  *     S_TYPE_OBJECT       - ".o" file
  76.  *     S_TYPE_BINARY       - executable
  77.  *     S_TYPE_OTHER       - file that doesn't correspond to any
  78.  *                  specific type.  This is distinct
  79.  *                  from undefined, which says the type
  80.  *                  is uninitialized and may be inferred
  81.  *                  by parent directory or file name.
  82.  */
  83. #define S_TYPE_UNDEFINED 0
  84. #define S_TYPE_TMP 1
  85. #define S_TYPE_SWAP 2
  86. #define S_TYPE_OBJECT 3
  87. #define S_TYPE_BINARY 4
  88. #define S_TYPE_OTHER 5
  89.  
  90. extern int fstat _ARGS_((int fd, struct stat *buf));
  91. extern int lstat _ARGS_((char *path, struct stat *buf));
  92. extern int stat _ARGS_((char *path, struct stat *buf));
  93.  
  94. extern int mkdir _ARGS_((char *path, int mode));
  95.  
  96. #endif /* _STAT */
  97.